# Maintainer: Affe Null <affenull2345@gmail.com>
pkgname=wroomd
pkgver=0.1.0
pkgrel=0
pkgdesc="Modem management daemon for Qualcomm platforms"
url="https://git.abscue.de/obp/wroomd"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	cargo
	cargo-auditable
	eudev-dev
	"
pkggroups="wroomd"
subpackages="$pkgname-openrc"
source="https://git.abscue.de/obp/wroomd/-/archive/$pkgver/wroomd-$pkgver.tar.bz2
	de.abscue.obp.Wroomd.conf
	wroomd.initd"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --release --frozen
}

package() {
	install -Dm755 target/release/wroomd -t "$pkgdir"/usr/bin
	install -Dm755 "$srcdir"/wroomd.initd "$pkgdir"/etc/init.d/wroomd
	install -Dm644 "$srcdir"/de.abscue.obp.Wroomd.conf -t "$pkgdir"/usr/share/dbus-1/system.d
}

sha512sums="
9edbcac983a909f4337520632f864c1eeef92f0483659e2c82eb656933614c5b7d6bb79f4cf7ce70f5a34b46787f197f3a106b7c876a6eaba5f84d6bb41b895a  wroomd-0.1.0.tar.bz2
4295f59367c61f6e60216281aea95829f966d5e4239a006fe855777544995baebac69fde659d0e275d07ee76da043c2bdadf990952915ac0dd452a177025f48c  de.abscue.obp.Wroomd.conf
b31398173ee291020cbd09bc5af40e65bf0ce7f86229727ba75ab4d8ffe0c7a4c99cc07d159aa5091beb943ed2bc4fe55fff2e06634866482571fc5c353593f3  wroomd.initd
"
